package com.app.bimo.module_bookrack.mvp.constract;



import com.app.bimo.commonbusiness.bean.BaseResult;
import com.app.bimo.commonbusiness.mvp.IModel;
import com.app.bimo.commonbusiness.mvp.IView;
import com.app.bimo.library_db.BookData;
import com.app.bimo.module_bookrack.mvp.model.entiy.OtherResult;

import java.util.List;

import io.reactivex.Observable;


public interface BookrackContract {
    //对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
    interface View extends IView {
        void bookrackDataNotify(List<BookData> lists, int page, boolean isChange);

        void getBookshelfRecommendNotify(BookData data);

        void bookrackErrorDataNotify(String s);

        void weekReadTimeNotify(OtherResult data);

        void getAnnounceNotify(List<OtherResult> list);

        void getBannerNotify(List<OtherResult> list);

    }

    //Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,如是否使用缓存
    interface Model extends IModel {
        Observable<BaseResult<List<BookData>>> getBooks(String page);

        Observable<BaseResult<BookData>> getBookshelfRecommend();

        Observable<BaseResult<OtherResult>> weekReadTime();

        Observable<BaseResult<List<OtherResult>>> getAnnounce();

        /**
         * 书架页面头部背景banner
         *
         * @param pisition
         * @return
         */
        Observable<BaseResult<List<OtherResult>>> getBanner(int pisition);
    }
}